import kwant
import numpy as np
import scipy
from matplotlib import pyplot
import kwant.continuum
hamiltonian = "k_x**2 + k_y**2"
template = kwant.continuum.discretize(hamiltonian)
print(template)
energies = []
step=0.021
nsteps=350
fermid0=[]
fermid1=[]
current2=[]
current3=np.zeros((15,8))
mu0=2.51
vbias=0.1
mu1=mu0+vbias
temperature=0.15
for ie in range(nsteps):
energy = ie * step
energies.append(energy)
fd0=kwant.kpm.fermi_distribution(energy, mu0,temperature)
fd1=kwant.kpm.fermi_distribution(energy, mu1,temperature)
fermid0.append(fd0)
fermid1.append(fd1)
pyplot.figure()
pyplot.plot(energies, fermid0)
pyplot.plot(energies, fermid1)
pyplot.xlabel("energy [t]")
pyplot.ylabel("Fermi distribution")
pyplot.show()
z0=2
wdt0=2
t=1
a=1
lat = kwant.lattice.square(a,norbs=1)
# Definition of Up lead
sym_up_lead = kwant.TranslationalSymmetry((0, -a))
up_lead = kwant.Builder(sym_up_lead)
for j in range(20):
up_lead[lat(-23+j,0)] = 4 * t
if j > 0:
up_lead[lat(-23+j,0), lat(-23+j-1,0)] = -t
up_lead[lat(-23+j,1), lat(-23+j,0)] = -t
# Definition of Down lead
sym_down_lead = kwant.TranslationalSymmetry((0, a))
down_lead = kwant.Builder(sym_down_lead)
for j in range(20):
down_lead[lat(3+j,0)] = 4 * t
if j > 0:
down_lead[lat(3+j,0), lat(3+j-1,0)] = -t
down_lead[lat(3+j,1), lat(3+j,0)] = -t
# Construction of 2-parametric family of systems varying smoothness and the width of the third way
for nz in range(15):
z=z0+nz*12
# ДВА ПУТИ
def twoways(site):
(x, y) = site.pos
xl = max(abs(x) - 20, 0)
xs= max(abs(x) - 28, 0)
return (1.2*xl**z + 1.2*y**z < 30**z and xs**z + y**z > 14**z)
syst2 = kwant.Builder()
syst2.fill(template,twoways, (0, 20));
syst2.attach_lead(up_lead)
syst2.attach_lead(down_lead)
if nz==0:
kwant.plot(syst2)
syst2 = syst2.finalized()
data2 = []
for ie in range(nsteps):
energy = ie * step
# compute the scattering matrix at a given energy
smatrix2 = kwant.smatrix(syst2, energy)
# compute the transmission probability from lead 0 to
# lead 1
data2.append(smatrix2.transmission(1, 0))
prd0=np.multiply(data2,fermid0)
prd1=np.multiply(data2,fermid1)
Tcurrent01=scipy.integrate.simps(prd0, energies,even='avg')
Tcurrent10=scipy.integrate.simps(prd1, energies,even='avg')
Tcurrent=Tcurrent01-Tcurrent10
print(Tcurrent)
current2.append(Tcurrent)
for nw in range(8):
wdt=wdt0+nw*2
# ТРИ ПУТИ
def threeways(site):
(x, y) = site.pos
xl = max(abs(x) - 20, 0)
xs= max(abs(x) - 28, 0)
return (1.2*xl**z + 1.2*y**z < 30**z and xs**z + y**z > 14**z) or (abs(x)<wdt and abs(y)<25.5)
syst3 = kwant.Builder()
syst3.fill(template,threeways, (0, 10));
syst3.attach_lead(up_lead)
syst3.attach_lead(down_lead)
syst3 = syst3.finalized()
#kwant.plot(syst3)
data3 = []
for ie in range(nsteps):
energy = ie * step
# compute the scattering matrix at a given energy
smatrix3 = kwant.smatrix(syst3, energy)
# compute the transmission probability from lead 0 to
# lead 1
#energies.append(energy)
data3.append(smatrix3.transmission(1, 0))
prd0=np.multiply(data3,fermid0)
prd1=np.multiply(data3,fermid1)
Tcurrent01=scipy.integrate.simps(prd0, energies,even='avg')
Tcurrent10=scipy.integrate.simps(prd1, energies,even='avg')
Tcurrent=Tcurrent01-Tcurrent10
print(Tcurrent)
current3[nz,nw]=Tcurrent
pyplot.figure()
pyplot.plot(energies, data2,color = 'b')
pyplot.plot(energies, data3, color = 'g')
pyplot.xlabel("energy [t]")
pyplot.ylabel("conductance [e^2/h]")
pyplot.show()
# Discrete coordinates: x y # Onsite element: (4+0j) # Hopping from (1, 0): (-1+0j) # Hopping from (0, 1): (-1+0j)
C:\Users\Planeswalker\anaconda3\lib\site-packages\sympy\__init__.py:672: SymPyDeprecationWarning: importing sympy.matrices.matrices with 'from sympy import *' has been deprecated since SymPy 1.6. Use import sympy.matrices.matrices instead. See https://github.com/sympy/sympy/issues/18245 for more info. self.Warn( C:\Users\Planeswalker\anaconda3\lib\site-packages\sympy\__init__.py:672: SymPyDeprecationWarning: importing sympy.matrices.matrices with 'from sympy import *' has been deprecated since SymPy 1.6. Use import sympy.matrices.matrices instead. See https://github.com/sympy/sympy/issues/18245 for more info. self.Warn(
-0.23413981308261178 -0.3142072341540145
-0.3720959751342381
-0.384422448762443
-0.41404222946234537
-0.42241170517951776
-0.4497881263654264
-0.49497146319307106
-0.52719125507436
-0.43214979775120455 -0.4455490392221515
-0.4624303354956645
-0.463556421983105
-0.4564820713060538
-0.4642034595753177
-0.4712872195091311
-0.4961030618844138
-0.5554728850504471
-0.42028280673298646 -0.4236842755527075
-0.4380930471108524
-0.4271334154804638
-0.43170543790767546
-0.4172816168924669
-0.43333769857656534
-0.4753436608346231
-0.516127257469698
-0.4720577963817485 -0.4578012355297121
-0.459562769852373
-0.43792737741643073
-0.4084191623292641
-0.41541004015438343
-0.4383419872910208
-0.4709106401289551
-0.5241510156810101
-0.4160344283303967 -0.425597619062672
-0.43784721582262254
-0.41602981606900613
-0.43372454648449654
-0.4366144765231912
-0.43613582708468623
-0.4683095366299215
-0.5148259821762835
-0.43354138181749313 -0.42300440023844743
-0.44860577535544977
-0.4244873428805134
-0.43546844215664393
-0.4451468233773621
-0.4374337977829894
-0.47142732272168164
-0.5222935214162217
-0.4198083707975968 -0.4105814471469138
-0.43303727231158007
-0.42686380516371525
-0.42858336937057917
-0.4244338796244618
-0.42799678515231143
-0.4616405750555428
-0.5174358165479713
-0.4106837130321406 -0.4140488629729022
-0.4194255577390482
-0.42106317412011673
-0.42590440573397004
-0.4226539526305917
-0.4381924006914746
-0.4599379059414348
-0.515850640036053
-0.4106837130321406 -0.4140488629729022
-0.4194255577390482
-0.42106317412011673
-0.42590440573397004
-0.4226539526305917
-0.4381924006914746
-0.4599379059414348
-0.515850640036053
-0.4106837130321406 -0.4140488629729022
-0.4194255577390482
-0.42106317412011673
-0.42590440573397004
-0.4226539526305917
-0.4381924006914746
-0.4599379059414348
-0.515850640036053
-0.4233693898443054 -0.4237021127171383
-0.43236941618876656
-0.4289283132567707
-0.4210565863137816
-0.41645097514967144
-0.42261342285572123
-0.4444386831025664
-0.5105116864467867
-0.4720577963817485 -0.4578012355297121
-0.459562769852373
-0.43792737741643073
-0.4084191623292641
-0.41541004015438343
-0.4383419872910208
-0.4709106401289551
-0.5241510156810101
-0.4720577963817485 -0.4578012355297121
-0.459562769852373
-0.43792737741643073
-0.4084191623292641
-0.41541004015438343
-0.4383419872910208
-0.4709106401289551
-0.5241510156810101
-0.4720577963817485 -0.4578012355297121
-0.459562769852373
-0.43792737741643073
-0.4084191623292641
-0.41541004015438343
-0.4383419872910208
-0.4709106401289551
-0.5241510156810101
-0.44368326667923075 -0.4425880917215368
-0.4528802150707749
-0.43801340842693826
-0.4300319394441221
-0.4121455474289917
-0.4319645860678092
-0.4612580017511414
-0.5118376512895324
print(fermid0)
[0.9999546021312976, 0.9999434314041399, 0.9999295121702223, 0.999912168279002, 0.9998905573016795, 0.9998636296729204, 0.9998300778108584, 0.9997882727672409, 0.9997361853670718, 0.9996712880642522, 0.9995904328350139, 0.9994896993167265, 0.9993642060316048, 0.9992078758616048, 0.999013144904479, 0.9987706013787226, 0.9984685382929966, 0.9980924000956662, 0.997624099433555, 0.9970411754780928, 0.9963157601005641, 0.9954133127082959, 0.9942910792229765, 0.9928962262756114, 0.9911635995393923, 0.9890130573694068, 0.986346340902649, 0.9830434644897993, 0.9789586529795317, 0.973915924853617, 0.9677045353015495, 0.960074666047186, 0.9507339939159732, 0.9393460966843479, 0.9255320548339719, 0.9088770389851438, 0.8889440332885924, 0.8652969480479719, 0.8375349374193038, 0.805338416408422, 0.7685247834990175, 0.7271082163411295, 0.6813537337890254, 0.6318124177361016, 0.5793242521487495, 0.5249791874789398, 0.4700359482354282, 0.41580947706459237, 0.3635474597184335, 0.31431988606174616, 0.26894142136999494, 0.22793645057321618, 0.1915453485614673, 0.15976199694366894, 0.13238887354206536, 0.10909682119561279, 0.08948005933356137, 0.0731011734223782, 0.05952436597650146, 0.04833762871990519, 0.039165722796764356, 0.03167622837905641, 0.02558078831200764, 0.020633297226906176, 0.01662635610788161, 0.013386917827664768, 0.010771730045141625, 0.008662943784813148, 0.0069640891777620765, 0.0055965092245897925, 0.004496273160941178, 0.003611550534431548, 0.0029004058017841924, 0.0023289641515467346, 0.0018698975270840476, 0.0015011822567369904, 0.0012050842337789467, 0.0009673329580677733, 0.000776451208270842, 0.0006232122502879981, 0.0005002011070795635, 0.0004014604475828209, 0.0003222051005313433, 0.0002585921040492912, 0.0002075356227423806, 0.00016655806477733576, 0.0001336703746336346, 0.00010727582017544021, 8.609268612756602e-05, 6.90921736679758e-05, 5.544852472279481e-05, 4.449897067489741e-05, 3.57115742795525e-05, 2.8659411780795752e-05, 2.2999846864756175e-05, 1.8457893295667007e-05, 1.4812860334722366e-05, 1.1887633644644067e-05, 9.540071859239872e-06, 7.656101424931988e-06, 6.144174602214707e-06, 4.9308215990976286e-06, 3.9570808758613e-06, 3.1756342695330296e-06, 2.548507794994876e-06, 2.04522644156373e-06, 1.6413333283691194e-06, 1.317201276686256e-06, 1.0570790602109344e-06, 8.48325993842589e-07, 6.807976709118475e-07, 5.463530019701201e-07, 4.3845860171150077e-07, 3.5187130046942014e-07, 2.823833527124587e-07, 2.2661796142085853e-07, 1.8186518213514841e-07, 1.4595023260012269e-07, 1.1712780860450251e-07, 9.399727034347235e-08, 7.543457780806636e-08, 6.053766760916058e-08, 4.858261682196353e-08, 3.898846362789507e-08, 3.1288975205971194e-08, 2.5109990926928157e-08, 2.015123983545206e-08, 1.617174883455595e-08, 1.2978132477106099e-08, 1.0415195302018455e-08, 8.358390031511923e-09, 6.707765132062501e-09, 5.383107617928223e-09, 4.320045059434885e-09, 3.466917371199144e-09, 2.7822663632748573e-09, 2.2328210586935823e-09, 1.7918808728782032e-09, 1.4380180847030298e-09, 1.1540365451119034e-09, 9.261360211990473e-10, 7.43241566618345e-10, 5.964653287258513e-10, 4.78674638691747e-10, 3.841453956943365e-10, 3.0828390121882793e-10, 2.4740362585237867e-10, 1.985460604403111e-10, 1.5933694577099114e-10, 1.2787089419517216e-10, 1.0261879630648792e-10, 8.235351306190782e-11, 6.60902423115047e-11, 5.3038661817569796e-11, 4.256452312782054e-11, 3.41588299366717e-11, 2.7413103140767354e-11, 2.1999530581069182e-11, 1.7655036837735086e-11, 1.4168498941051902e-11, 1.137048673913741e-11, 9.125029350161324e-12, 7.323007585477033e-12, 5.876851244975625e-12, 4.716283596927612e-12, 3.784906243060018e-12, 3.0374584085834688e-12, 2.437617470918902e-12, 1.956233842655111e-12, 1.5699144319417139e-12, 1.259885842826199e-12, 1.0110820721550744e-12, 8.114123691874652e-13, 6.511736791723141e-13, 5.225791182742399e-13, 4.1937956583777704e-13, 3.3655998506618844e-13, 2.7009571465760453e-13, 2.167568882618484e-13, 1.739514774179935e-13, 1.3959933056128982e-13, 1.120310869584166e-13, 8.990705324030017e-14, 7.215210029475535e-14, 5.790341679901635e-14, 4.64685804474674e-14, 3.7291909323724656e-14, 2.99274582442014e-14, 2.401734781620886e-14, 1.9274373099710874e-14, 1.5468046731460323e-14, 1.2413398269759036e-14, 9.961985458076566e-15, 7.994680595135264e-15, 6.415881461301968e-15, 5.148865478193781e-15, 4.132061334430584e-15, 3.3160568952144734e-15, 2.6611979935226934e-15, 2.1356614149020103e-15]
print(current2)
[-0.12010536803729499, -0.30015152097768016, -0.2591981735538367, -0.329930254075089, -0.26747288364902033, -0.26650633340143104, -0.25507087823691776, -0.2599245617241892, -0.2599245617241892, -0.2599245617241892, -0.2808634373173686, -0.329930254075089, -0.329930254075089, -0.329930254075089, -0.30627868244500434]
kwant.plot(syst3)
print(current2)
[-0.23413981308261178, -0.43214979775120455, -0.42028280673298646, -0.4720577963817485, -0.4160344283303967, -0.43354138181749313, -0.4198083707975968, -0.4106837130321406, -0.4106837130321406, -0.4106837130321406, -0.4233693898443054, -0.4720577963817485, -0.4720577963817485, -0.4720577963817485, -0.44368326667923075]
print(current3)
[[-0.31420723 -0.37209598 -0.38442245 -0.41404223 -0.42241171 -0.44978813 -0.49497146 -0.52719126] [-0.44554904 -0.46243034 -0.46355642 -0.45648207 -0.46420346 -0.47128722 -0.49610306 -0.55547289] [-0.42368428 -0.43809305 -0.42713342 -0.43170544 -0.41728162 -0.4333377 -0.47534366 -0.51612726] [-0.45780124 -0.45956277 -0.43792738 -0.40841916 -0.41541004 -0.43834199 -0.47091064 -0.52415102] [-0.42559762 -0.43784722 -0.41602982 -0.43372455 -0.43661448 -0.43613583 -0.46830954 -0.51482598] [-0.4230044 -0.44860578 -0.42448734 -0.43546844 -0.44514682 -0.4374338 -0.47142732 -0.52229352] [-0.41058145 -0.43303727 -0.42686381 -0.42858337 -0.42443388 -0.42799679 -0.46164058 -0.51743582] [-0.41404886 -0.41942556 -0.42106317 -0.42590441 -0.42265395 -0.4381924 -0.45993791 -0.51585064] [-0.41404886 -0.41942556 -0.42106317 -0.42590441 -0.42265395 -0.4381924 -0.45993791 -0.51585064] [-0.41404886 -0.41942556 -0.42106317 -0.42590441 -0.42265395 -0.4381924 -0.45993791 -0.51585064] [-0.42370211 -0.43236942 -0.42892831 -0.42105659 -0.41645098 -0.42261342 -0.44443868 -0.51051169] [-0.45780124 -0.45956277 -0.43792738 -0.40841916 -0.41541004 -0.43834199 -0.47091064 -0.52415102] [-0.45780124 -0.45956277 -0.43792738 -0.40841916 -0.41541004 -0.43834199 -0.47091064 -0.52415102] [-0.45780124 -0.45956277 -0.43792738 -0.40841916 -0.41541004 -0.43834199 -0.47091064 -0.52415102] [-0.44258809 -0.45288022 -0.43801341 -0.43003194 -0.41214555 -0.43196459 -0.461258 -0.51183765]]